docs: add CLAUDE.md documenting the machine-spec drift gate (#1666) - #49
Merged
Conversation
Record the error-codes / RPC machine-spec drift gate where a contributor looks first: scripts/dig-spec.mjs (source of truth), docs/support/error-codes.md (prose), and the static/*.json generated artifacts move together, and `npm run gen` (wired into prebuild/prestart) drift-checks the prose against the source — so editing error-codes.md alone fails the build. Points at the frontend-baseline skill for the general pattern. Closes dig_ecosystem#1666 Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes dig_ecosystem#1666.
docs.dig.net had no repo-root
CLAUDE.md, so the machine-spec drift gate — the one load-bearing gotcha here — was documented nowhere a contributor/agent looks first. The first symptom of tripping it is an unexplainednpm run buildfailure on what looked like a one-line docs edit.What this adds
A concise
CLAUDE.mddocumenting the drift gate, verified against source (not just restated from the ticket):scripts/dig-spec.mjs(source of truth),docs/support/error-codes.md+docs/rpc/*.md(prose), andstatic/*.json(generated) move together.scripts/gen-machine-specs.mjsdriftGate()parses the prose tables andassertSetEquals them against the catalog, throwingerror-codes drift for <surface> …on divergence (line 151), before the JSON is written.npm run genruns that check and is wired intoprebuild/prestart, so editingerror-codes.mdalone fails the build; the fix is to mirror the change indig-spec.mjsandnpm run genin the same commit — never to weaken the gate.Also points at the superproject
frontend-baselineskill, where the general pattern (any canonical-source + prose-mirror surface carries a documented regen ceremony) is being recorded.Verification
Drift-check confirmed load-bearing by reading
gen-machine-specs.mjs(driftGate→assertSetEqualthrows; runs at module top-level beforewriteFileSync). Docs-only change + version bump0.7.0 → 0.7.1(patch).Generated by Claude Code